#include <stdio.h>
#include <stdlib.h>

int main()
{
    int n;
    scanf("%d", &n);
    int *a = 0;
    a = (int *)malloc(n * sizeof(int));
    scanf("%d", &a[0]);
    int maxN = a[0];
    for (int i = 1; i < n; i++)
    {
        scanf("%d", &a[i]);
        if(a[i] > maxN)maxN = a[i];
    }
    printf("%d", maxN);

    free(a);
    return 0;
}